package com.aspose.cells;

import java.util.ArrayList;
import java.util.List;

final class zawc {
   static ArrayList a(zn var0, zbcq var1, com.aspose.cells.b.a.b.zp var2, int var3) throws Exception {
      zig var4 = var1.v();
      int var5 = var1.ag();
      int[] var6 = new int[]{57, 58, 59};
      zbp var7;
      zbp var8;
      if (var5 == 1) {
         var8 = var4.e();
         var7 = var4.G();
      } else {
         var8 = var4.g();
         var7 = var4.I();
      }

      zbcs var9 = var4.z();
      int var10 = var9.getCount();
      ArrayList var11 = new ArrayList();
      double var12 = (double)var2.c() + (double)var2.e() / 2.0D;
      double var14 = (double)var2.d() + (double)var2.f() / 2.0D;
      double var16 = (double)(var2.e() / 2);
      double var18 = 6.283185307179586D / (double)var3;
      int var20 = var1.aj();
      ArrayList var21 = new ArrayList();
      ArrayList var22 = new ArrayList();
      zjg var23 = var1.E();
      double var24 = 1.5707963267948966D;

      for(int var26 = 0; var26 < var3; ++var26) {
         zje var27 = var23.b(var26);
         double var28;
         double var30;
         double var32;
         double var34;
         com.aspose.cells.b.a.b.zo var36;
         if (var27 != null) {
            var28 = Math.abs(var27.v() - var7.D());
            var30 = var16 * var28 / (var7.z() - var7.D());
            var32 = var12 + var30 * Math.cos(var24);
            var34 = var14 - var30 * Math.sin(var24);
            var36 = new com.aspose.cells.b.a.b.zo((float)var32, (float)var34);
            com.aspose.cells.b.a.a.ze.a(var21, (Object)var36);
            com.aspose.cells.b.a.a.ze.a(var22, (Object)var36);
            var1.B().a((float)var32, (float)var34);
            zpu var37 = var27.o();
            com.aspose.cells.b.a.b.zt var38 = zpw.a(var0, var8, var9, var20, var26, (int)var16);
            double var39 = var30 + (double)(var38.b() / 2.0F) + (double)(var38.c() / 2.0F);
            double var41 = var12 + var39 * Math.cos(var24);
            double var43 = var14 - var39 * Math.sin(var24);
            Object[] var45 = new Object[]{var20, var26, new com.aspose.cells.b.a.b.zo((float)var41, (float)var43), var8, var16};
            com.aspose.cells.b.a.a.ze.a(var11, (Object)var45);
         } else {
            com.aspose.cells.b.a.a.ze.a(var21, (Object)null);
            com.aspose.cells.b.a.a.ze.a(var22, (Object)(new com.aspose.cells.b.a.b.zo((float)var12, (float)var14)));
         }

         if (var26 == var3 - 1) {
            var27 = var23.b(0);
            if (var27 != null) {
               var28 = Math.abs(var27.v() - var7.D());
               var30 = var16 * var28 / (var7.z() - var7.D());
               var32 = var12 + var30 * Math.cos(1.5707963267948966D);
               var34 = var14 - var30 * Math.sin(1.5707963267948966D);
               var36 = new com.aspose.cells.b.a.b.zo((float)var32, (float)var34);
               com.aspose.cells.b.a.a.ze.a(var21, (Object)var36);
            } else {
               com.aspose.cells.b.a.a.ze.a(var21, (Object)null);
            }
         }

         var24 -= var18;
      }

      if (var1.ah() != 59) {
         if (var21.size() > 1) {
            zkr.a(var0, var1, var21, var2);
         }
      } else {
         a(var0, (List)var22, (zbcq)var1);
      }

      return var11;
   }

   static void a(zn var0, zig var1, ArrayList var2) throws Exception {
      for(int var3 = 0; var3 < var2.size(); ++var3) {
         Object[] var4 = (Object[])((Object[])var2.get(var3));
         int var5 = (Integer)var4[0];
         int var6 = (Integer)var4[1];
         com.aspose.cells.b.a.b.zo var7 = (com.aspose.cells.b.a.b.zo)var4[2];
         zbp var8 = (zbp)var4[3];
         int var9 = com.aspose.cells.b.a.ze.f(var4[4]);
         zkr.a(var0, var8, var5, var6, var7, var9);
      }

   }

   private static void a(zn var0, List var1, zbcq var2) {
      com.aspose.cells.b.a.b.zo[] var3 = new com.aspose.cells.b.a.b.zo[var1.size()];
      zbuk.a(var3);

      for(int var4 = 0; var4 < var1.size(); ++var4) {
         com.aspose.cells.b.a.b.zo var5 = (com.aspose.cells.b.a.b.zo)var1.get(var4);
         var3[var4] = var5;
      }

      com.aspose.cells.b.a.b.a.ze var6 = new com.aspose.cells.b.a.b.a.ze();
      var6.b(var3);
      var2.A().a(var6);
      var2.z().a(var6);
   }
}
